/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.dp.vo;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author wyr
 */
@Entity
@Table(name = "news_extends_firstchannel")
//@NamedQueries({@NamedQuery(name = "NewsExtendsFirstchannel.findAll", query = "SELECT n FROM NewsExtendsFirstchannel n"), @NamedQuery(name = "NewsExtendsFirstchannel.findByChannelid", query = "SELECT n FROM NewsExtendsFirstchannel n WHERE n.channelid = :channelid"), @NamedQuery(name = "NewsExtendsFirstchannel.findByChanneltype", query = "SELECT n FROM NewsExtendsFirstchannel n WHERE n.channeltype = :channeltype"), @NamedQuery(name = "NewsExtendsFirstchannel.findByCreater", query = "SELECT n FROM NewsExtendsFirstchannel n WHERE n.creater = :creater"), @NamedQuery(name = "NewsExtendsFirstchannel.findByLastupdate", query = "SELECT n FROM NewsExtendsFirstchannel n WHERE n.lastupdate = :lastupdate"), @NamedQuery(name = "NewsExtendsFirstchannel.findByServiceCode", query = "SELECT n FROM NewsExtendsFirstchannel n WHERE n.serviceCode = :serviceCode")})
public class NewsExtendsFirstchannel implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "channelid")
    private Integer channelid;
    @Column(name = "channeltype")
    private Integer channeltype;
    @Column(name = "creater")
    private String creater;
    @Column(name = "lastupdate")
    @Temporal(TemporalType.TIMESTAMP)
    private Date lastupdate;
    @Column(name = "service_code")
    private String serviceCode;
    @JoinTable(name = "news_catlog_channel", joinColumns = {@JoinColumn(name = "channelid", referencedColumnName = "channelid")}, inverseJoinColumns = {@JoinColumn(name = "catlogid", referencedColumnName = "catlogid")})
    @ManyToMany
    private Set<NewsCatlog> newsCatlogSet;
    @ManyToMany(mappedBy = "newsExtendsFirstchannelSet")
    private Set<NewsAds> newsAdsSet;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "newsExtendsFirstchannel")
    private Set<NewsExtendsFirstchannelButtons> newsExtendsFirstchannelButtonsSet;
    @OneToMany(mappedBy = "channelid")
    private Set<NewsContenttype> newsContenttypeSet;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "newsExtendsFirstchannel")
    private Set<NewsExtendsFirstchannelChannels> newsExtendsFirstchannelChannelsSet;
    @JoinColumn(name = "channel_id", referencedColumnName = "channel_id")
    @ManyToOne
    private TChannels channelId;

    public NewsExtendsFirstchannel() {
    }

    public NewsExtendsFirstchannel(Integer channelid) {
        this.channelid = channelid;
    }

    public Integer getChannelid() {
        return channelid;
    }

    public void setChannelid(Integer channelid) {
        this.channelid = channelid;
    }

    public Integer getChanneltype() {
        return channeltype;
    }

    public void setChanneltype(Integer channeltype) {
        this.channeltype = channeltype;
    }

    public String getCreater() {
        return creater;
    }

    public void setCreater(String creater) {
        this.creater = creater;
    }

    public Date getLastupdate() {
        return lastupdate;
    }

    public void setLastupdate(Date lastupdate) {
        this.lastupdate = lastupdate;
    }

    public String getServiceCode() {
        return serviceCode;
    }

    public void setServiceCode(String serviceCode) {
        this.serviceCode = serviceCode;
    }

    public Set<NewsCatlog> getNewsCatlogSet() {
        return newsCatlogSet;
    }

    public void setNewsCatlogSet(Set<NewsCatlog> newsCatlogSet) {
        this.newsCatlogSet = newsCatlogSet;
    }

    public Set<NewsAds> getNewsAdsSet() {
        return newsAdsSet;
    }

    public void setNewsAdsSet(Set<NewsAds> newsAdsSet) {
        this.newsAdsSet = newsAdsSet;
    }

    public Set<NewsExtendsFirstchannelButtons> getNewsExtendsFirstchannelButtonsSet() {
        return newsExtendsFirstchannelButtonsSet;
    }

    public void setNewsExtendsFirstchannelButtonsSet(Set<NewsExtendsFirstchannelButtons> newsExtendsFirstchannelButtonsSet) {
        this.newsExtendsFirstchannelButtonsSet = newsExtendsFirstchannelButtonsSet;
    }

    public Set<NewsContenttype> getNewsContenttypeSet() {
        return newsContenttypeSet;
    }

    public void setNewsContenttypeSet(Set<NewsContenttype> newsContenttypeSet) {
        this.newsContenttypeSet = newsContenttypeSet;
    }

    public Set<NewsExtendsFirstchannelChannels> getNewsExtendsFirstchannelChannelsSet() {
        return newsExtendsFirstchannelChannelsSet;
    }

    public void setNewsExtendsFirstchannelChannelsSet(Set<NewsExtendsFirstchannelChannels> newsExtendsFirstchannelChannelsSet) {
        this.newsExtendsFirstchannelChannelsSet = newsExtendsFirstchannelChannelsSet;
    }

    public TChannels getChannelId() {
        return channelId;
    }

    public void setChannelId(TChannels channelId) {
        this.channelId = channelId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (channelid != null ? channelid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof NewsExtendsFirstchannel)) {
            return false;
        }
        NewsExtendsFirstchannel other = (NewsExtendsFirstchannel) object;
        if ((this.channelid == null && other.channelid != null) || (this.channelid != null && !this.channelid.equals(other.channelid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.dp.vo.NewsExtendsFirstchannel[channelid=" + channelid + "]";
    }

}
